<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .red{
            color: red;
        }
    </style>
</head>
<body>
    <div id="app">
        <ul><li v-for="(item,index) in movies" v-on:click="getClass(index)" :class="{red:isred===index}">{{item}}</li></ul>
    </div>
        <script src="vue.js"></script>
        <script>
            app = new Vue({
                el: '#app',
                data:{
                    movies:["测试列表1", "测试列表2", "测试列表3", "测试列表4", "测试列表5"],
                    isred: 0
                },
                methods:{
                getClass: function (index) {
                        this.isred = index
                    }
                }
            })
        </script>

</body>
</html>